<template>
  <el-form
    :model="dynamicValidateForm"
    ref="dynamicValidateForm"
    label-width="600px"
    class="demo-dynamic"
  >
    <el-form-item class="vorify">
      <span style="font-size:20px;font-weight:bold;" class="validate">{{$t('reg.vorify')}}</span>
    </el-form-item>
    <el-form-item>{{$t('reg.code')}}</el-form-item>
    <el-form-item
      label="验证码"
      prop="code"
      :rules="[
      { required: true, message: '验证码不能为空'},
      { type: 'number', message: '验证码必须为数字值'}
    ]"
    >
      <el-input v-model="dynamicValidateForm.code" class="dynamicValidateForm"></el-input>
    </el-form-item>
    <el-form-item>
      <el-button type="primary" size="small" class="reg-code" @click="handleTab(2)">{{$t('reg.volification')}}</el-button>
    </el-form-item>
  </el-form>
</template>
<script>
import { mapGetters } from "vuex";
import website from "@/config/website";
export default {
  data() {
    return {
      dynamicValidateForm: {
        domains: [
          {
            value: ""
          }
        ],
        email: ""
      }
    };
  },
  methods: {
    submitForm(formName) {
      this.$refs[formName].validate(valid => {
        if (valid) {
          alert("submit!");
        } else {
          console.log("error submit!!");
          return false;
        }
      });
    },
    resetForm(formName) {
      this.$refs[formName].resetFields();
    },
    removeDomain(item) {
      var index = this.dynamicValidateForm.domains.indexOf(item);
      if (index !== -1) {
        this.dynamicValidateForm.domains.splice(index, 1);
      }
    },
    addDomain() {
      this.dynamicValidateForm.domains.push({
        value: "",
        key: Date.now()
      });
    }
  }
};
</script>
<style lang="scss"  scoped>
.el-input__inner {
  -webkit-appearance: none;
  background-color: #fff;
  background-image: none;
  border-radius: 4px;
  border: 1px solid #dcdfe6;
  -webkit-box-sizing: border-box;
  box-sizing: border-box;
  color: #606266;
  display: inline-block;
  font-size: inherit;
  height: 40px;
  line-height: 40px;
  outline: 0;
  padding: 0 15px;
  -webkit-transition: border-color 0.2s cubic-bezier(0.645, 0.045, 0.355, 1);
  transition: border-color 0.2s cubic-bezier(0.645, 0.045, 0.355, 1);
  width: 200px;
}

.el-form-item__content {
  line-height: 40px;
  position: relative;
  font-size: 1px;
}
.el-form-item__content {
  line-height: 40px;
  position: relative;
  font-size: 2px !important;
}
.el-button--primary {
  color: #fff;
  background-color: #409eff;
  border-color: #409eff;
  width: 302px;
  height: 40px;
  margin-top:20px;
}
.dynamicValidateForm{
 width: 300px;
}
.validate{
  margin-left: 100px;
}
</style>
